#!/usr/bin/env python
#coding=utf-8

import socket, time

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host = '127.0.0.1'
port = 50007
s.connect((host, port))

while True:
	init_str = raw_input("input: ")

	s.sendall(init_str)

	print 'send', init_str

	data = s.recv(1024)
	print 'recv', data

s.close()